package com.jintian.smart.kernel.flowable.flowable.cmd;

import java.util.List;

import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.identitylink.service.IdentityLinkService;
import org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntity;

/**
 * 跳转
 */
public class FetchTaskIdentityLinkEntityCmd implements Command<List<IdentityLinkEntity>> {
    private final String taskId;

    public FetchTaskIdentityLinkEntityCmd(String taskId) {
        this.taskId = taskId;
    }

    @Override
    public List<IdentityLinkEntity> execute(CommandContext commandContext) {
        IdentityLinkService service = CommandContextUtil.getIdentityLinkService(commandContext);
        return service.findIdentityLinksByTaskId(taskId);
    }
}